//********************************************************************************************************************//
//ORGANIZATION:
//AUTHOR: bpeng(bogers.peng@gmail.com)
//SUMMARY:
//********************************************************************************************************************//
#ifndef NATIVE_SYSTEM_PLATFORM_FILEPATH_H
#define NATIVE_SYSTEM_PLATFORM_FILEPATH_H

#ifndef NATIVE_SYSTEM_BASE_TYPES_H
#include "System/Base/Types.h"
#endif

namespace Native { namespace System { namespace Platform
{
    NATIVE_DECLARE_CONST_OBJECT(CFilePath, C_FILE_PATH);
    class NATIVE_LIBRARY_EXPORT CFilePath :
        public CObject
    {
        NATIVE_DECLARE_OBJECT;

    protected:
        CArray<CString> _directory;
        wchar_t _division;
        CString _filename;
        bool _relative;

        CString _ToDirectyString(size_t depth) const;

    protected:
        CFilePath();
    public:
        CFilePath(C_STRING& path, wchar_t division=L'\\');
        CFilePath(
            C_STRING& directory,
            C_STRING& filename,
            wchar_t division = L'\\');
        CFilePath(C_FILE_PATH& that);
        CFilePath(C_FILE_PATH&& that);
        virtual ~CFilePath();

        size_t Depth() const;
        bool Relative() const;
        CString Path() const;
        CString Filename() const;
        CString Directory() const;
        CString ParentDirectory() const;

        virtual C_FILE_PATH& operator=(C_FILE_PATH& rvalue);
    };
}}}

#endif